//
//  BaseView.h
//  DreamOf
//
//  Created by 薛小刚 on 2018/5/24.
//  Copyright © 2018年 薛小刚. All rights reserved.
//

#import <UIKit/UIKit.h>

/// 定义tableView代理的block
typedef NSInteger(^numberOfSectionsInTableView)(UITableView * tableView);
typedef NSInteger(^numberOfRowsInSection)(UITableView * tableView, NSInteger section);
typedef UIView *(^viewForHeaderInSection)(UITableView * tableView, NSInteger section);
typedef UIView *(^viewForFooterInSection)(UITableView * tableView, NSInteger section);
typedef UITableViewCell *(^cellForRowAtIndexPath)(UITableView * tableView, NSIndexPath * indexPath);
typedef void(^didSelectRowAtIndexPath)(UITableView * tableView, NSIndexPath * indexPath);

typedef UIImage *(^emptyDataShowImage)(void);
typedef void(^emptyDataTapAction)(void);

typedef void(^TableViewHeaderFresh)(void);
typedef void(^TableViewFooterFresh)(void);



@interface BaseView : UIView

@property (nonatomic, strong) UITableView * tableView;

- (void)setTableViewFrameWithTop:(CGFloat)top left:(CGFloat)left right:(CGFloat)right bottom:(CGFloat)bottom;

@property (nonatomic, copy) numberOfSectionsInTableView numberOfSectionsBlock;
@property (nonatomic, copy) numberOfRowsInSection numberOfRowsBlock;
@property (nonatomic, copy) viewForHeaderInSection viewForHeaderBlock;
@property (nonatomic, copy) viewForFooterInSection viewForFooterBlock;
@property (nonatomic, copy) cellForRowAtIndexPath cellForRowBlock;
@property (nonatomic, copy) didSelectRowAtIndexPath didSelectRow;
@property (nonatomic, copy) emptyDataShowImage emptyDataShowImage;
@property (nonatomic, copy) emptyDataTapAction emptyDataAction;
@property (nonatomic, copy) BOOL (^emptyShow)(void);

- (void)setTableViewHeaderFresh:(TableViewHeaderFresh) fresh;
- (void)setTableViewFooterFresh:(TableViewHeaderFresh) fresh;
- (void)endRefresh;

@end
